package com.day01;

/**
 * @Author liuyuan
 * @Date 2022/11/4 11:11 AM
 * @Version 1.0
 */
public class Son extends Father{
    boolean isEer;

    public boolean isEer() {
        return isEer;
    }

    public void setEer(boolean eer) {
        isEer = eer;
    }

    void say(){
        System.out.println("Son:say");
    }

    @Override
    public String toString() {
        return "Son{" +
                "name='" + name + '\'' +
                ", height='" + height + '\'' +
                ", weight='" + weight + '\'' +
                ", isEer=" + isEer +
                '}';
    }

    public static void main(String[] args) {
        Father father = new Father();
        father.setHeight("180");
        father.setWeight("180");
        father.setName("张三");
        father.say();
        System.out.println(father.toString());
        Son son = new Son();
        son.setHeight("190");
        son.setName("张四");
        son.setWeight("190");

        //如果父亲和孩子都有这个方法，就近原则
        son.say();
        System.out.println(son.toString());

    }
}
